package com.mystudy.concurrent.classLoader;

/**
 * todo:
 *
 * @Author acy
 * @Date 2019/06/01
 */
public class SimpleEncrypt {
	private static final String plain="acy";

	private static final byte ENCRYPT_FACTORY= (byte) 0xff;

	public static void main(String[] args) {
		byte[] bytes = plain.getBytes();
		//加密
		byte[] encrypt = new byte[bytes.length];
		for (int i = 0; i < encrypt.length; i++) {
			encrypt[i]= (byte) (bytes[i]^ENCRYPT_FACTORY);
		}
		System.out.println(new String(encrypt));
		byte[] decrypt = new byte[encrypt.length];
		//解密
		for (int i = 0; i < encrypt.length; i++) {
			decrypt[i]= (byte) (encrypt[i]^ENCRYPT_FACTORY);
		}
		System.out.println(new String(decrypt));
	}
}
